class Message:
    task_vehicle_id: int = -1              # 消息发送者ID
    data_size: int = 0                     # 消息大小(M Byte), 影响任务传输延时


class Task(Message):
    type: int = -1                          # 计算任务类型, 以等级划分, 1 ~ 10, 越大则越重要, 任务完成奖励越多
    computing_power_demand: int = 0         # 计算任务计算能力需求 (cycle), 影响任务处理延时
    maximum_allowable_delay: int = 0        # 最大容许延时(ms)
    return_data_discount_factor: int = 0    # 返回数据与上传数据折扣因子, 0表示回传数据太小忽略, 只有娱乐类任务可能有大回传数据

    def __init__(self, task_vehicle_id="",
                 type=1,
                 data_size=0,
                 computing_power_demand=0,
                 maximum_allowable_delay=0,
                 return_data_discount_factor=0):
        self.task_vehicle_id = task_vehicle_id  # 发出计算任务的车辆ID
        self.type = type
        self.data_size = data_size  # 数据量大小, 单位为 M Byte
        self.computing_power_demand = computing_power_demand
        self.maximum_allowable_delay = maximum_allowable_delay
        self.return_data_discount_factor = return_data_discount_factor
